package com.yiyahui.project.erp.service.impl;

import java.util.List;
import com.yiyahui.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yiyahui.project.erp.mapper.YiyaMemberDetailMapper;
import com.yiyahui.project.erp.domain.YiyaMemberDetail;
import com.yiyahui.project.erp.service.IYiyaMemberDetailService;

/**
 * 会员积分流水Service业务层处理
 * 
 * @author yiyahui
 * @date 2020-06-12
 */
@Service
public class YiyaMemberDetailServiceImpl implements IYiyaMemberDetailService 
{
    @Autowired
    private YiyaMemberDetailMapper yiyaMemberDetailMapper;

    /**
     * 查询会员积分流水
     * 
     * @param id 会员积分流水ID
     * @return 会员积分流水
     */
    @Override
    public YiyaMemberDetail selectYiyaMemberDetailById(Long id)
    {
        return yiyaMemberDetailMapper.selectYiyaMemberDetailById(id);
    }

    /**
     * 查询会员积分流水列表
     * 
     * @param yiyaMemberDetail 会员积分流水
     * @return 会员积分流水
     */
    @Override
    public List<YiyaMemberDetail> selectYiyaMemberDetailList(YiyaMemberDetail yiyaMemberDetail)
    {
        return yiyaMemberDetailMapper.selectYiyaMemberDetailList(yiyaMemberDetail);
    }

    /**
     * 新增会员积分流水
     * 
     * @param yiyaMemberDetail 会员积分流水
     * @return 结果
     */
    @Override
    public int insertYiyaMemberDetail(YiyaMemberDetail yiyaMemberDetail)
    {
        yiyaMemberDetail.setCreateTime(DateUtils.getNowDate());
        return yiyaMemberDetailMapper.insertYiyaMemberDetail(yiyaMemberDetail);
    }

    /**
     * 修改会员积分流水
     * 
     * @param yiyaMemberDetail 会员积分流水
     * @return 结果
     */
    @Override
    public int updateYiyaMemberDetail(YiyaMemberDetail yiyaMemberDetail)
    {
        yiyaMemberDetail.setUpdateTime(DateUtils.getNowDate());
        return yiyaMemberDetailMapper.updateYiyaMemberDetail(yiyaMemberDetail);
    }

    /**
     * 批量删除会员积分流水
     * 
     * @param ids 需要删除的会员积分流水ID
     * @return 结果
     */
    @Override
    public int deleteYiyaMemberDetailByIds(Long[] ids)
    {
        return yiyaMemberDetailMapper.deleteYiyaMemberDetailByIds(ids);
    }

    /**
     * 删除会员积分流水信息
     * 
     * @param id 会员积分流水ID
     * @return 结果
     */
    @Override
    public int deleteYiyaMemberDetailById(Long id)
    {
        return yiyaMemberDetailMapper.deleteYiyaMemberDetailById(id);
    }
}
